package com.cloud.base.classSize;

import lombok.Data;
import org.openjdk.jol.info.ClassLayout;

/**
 * @author cloud
 * @version 1.0
 * @date 2020/4/17 16:04
 * 打印类的大小
 */
@Data
public class ClassSize {
    //<dependency>
//  <groupId>org.openjdk.jol</groupId>
//  <artifactId>jol-core</artifactId>
//  <version>0.10</version>
//</dependency>
    private String name;
    private int age;

    public static void main(String[] args) {
        ClassSize demo = new ClassSize();
        // 打印对象的大小
        System.out.println(ClassLayout.parseInstance(demo).toPrintable());
    }
}
